package com.tianxinweb.entity;

import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author cboy
 * @since 2018-07-19
 */
@TableName("tx_privilege")
public class Privilege implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "pid", type = IdType.AUTO)
    private Integer pid;
    /**
     * 权限URL
     */
    @Length(max = 255,message = "权限url不能超过255个字符")
    private String privUrl;
    /**
     * 权限名称
     */
    @NotNull
    @Length(max = 32,message = "权限名称不能超过32个字符")
    private String privName;
    /**
     * 权限描述
     */
    @Length(max = 255,message = "权限描述不能超过255个字符")
    private String privDesc;
    /**
     * 父权限
     */
    private Integer parentId;
    /**
     * 权限级别，默认为0表示一级权限，1表示2级权限，2表示3级权限
     */
    private Integer privLevel;
    /**
     * 菜单同级排序，默认为0表示不进行排序
     */
    @Max(value = 999)
    private Integer sort;
    /**
     * 权限路径
     */
    private String privPath;
    /**
     * 是否为菜单，默认为0表示非菜单，1表示菜单
     */
    private Boolean menuStatus;
    /**
     * 是否显示，默认为显示，为菜单时生效
     */
    private Boolean showStatus;
    /**
     * 菜单图标
     */
    @Length(max = 255,message = "权限icon不能超过255个字符")
    private String icon;


    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getPrivUrl() {
        return privUrl;
    }

    public void setPrivUrl(String privUrl) {
        this.privUrl = privUrl;
    }

    public String getPrivName() {
        return privName;
    }

    public void setPrivName(String privName) {
        this.privName = privName;
    }

    public String getPrivDesc() {
        return privDesc;
    }

    public void setPrivDesc(String privDesc) {
        this.privDesc = privDesc;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getPrivLevel() {
        return privLevel;
    }

    public void setPrivLevel(Integer privLevel) {
        this.privLevel = privLevel;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getPrivPath() {
        return privPath;
    }

    public void setPrivPath(String privPath) {
        this.privPath = privPath;
    }

    public Boolean getMenuStatus() {
        return menuStatus;
    }

    public void setMenuStatus(Boolean menuStatus) {
        this.menuStatus = menuStatus;
    }

    public Boolean getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Boolean showStatus) {
        this.showStatus = showStatus;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    @Override
    public String toString() {
        return "Privilege{" +
                "pid=" + pid +
                ", privUrl='" + privUrl + '\'' +
                ", privName='" + privName + '\'' +
                ", privDesc='" + privDesc + '\'' +
                ", parentId=" + parentId +
                ", privLevel=" + privLevel +
                ", sort=" + sort +
                ", privPath='" + privPath + '\'' +
                ", menuStatus=" + menuStatus +
                ", showStatus=" + showStatus +
                ", icon='" + icon + '\'' +
                '}';
    }
}
